package com.transaction.simulate.mapper;

import com.transaction.simulate.model.dto.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {

    @Insert("INSERT INTO t_role (roleCode, roleName, description) VALUES (#{roleCode},#{roleName},#{description})")
    void addRole(Role role);

    @Delete("delete from t_role where roleCode = #{roleCode}")
    void deleteRole(String roleCode);

    void insertRoleMenus(@Param("roleCode") String roleCode,
                         @Param("checkedMenuCodes") List<String> checkedMenuCodes);
}
